﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Profile;

using Gift.DAL;
using Gift.Model;

namespace WebSite.admin.title
{
    public partial class newsEdit02 : BaseAdmin
    {
        readonly DALNews theNews = new DALNews();
        tbNews oNews;

        // Methods
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            if (base.Request.QueryString["nid"] != null)
            {
                oNews = theNews.GetModel(int.Parse(Request.QueryString["nid"]));
                {
                    oNews.newsContent =  this.txtaContent.InnerText.Replace("'", "''") ;
                    theNews.Update(oNews);
                    ExtAspNet.Alert.Show("栏目内容修改成功！");
                }
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

         
            if (!base.IsPostBack)
            {
                this.BuildForm();
            }
        }

        private void BuildForm()
        {
            if (base.Request.QueryString["nid"] != null)
            {
                oNews = theNews.GetModel(int.Parse(Request.QueryString["nid"]));

                this.txtaContent.InnerText = oNews.newsContent.Replace("''", "'");
            }
            else
            {
                ExtAspNet.Alert.Show("请添加栏目基本信息！");
            }
        }

       

    }
}